<%@ page import="java.util.Date" %>
<%@ page import="java.util.Random" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <link href="<%=basePath%>assets/dist/css/d_index.css" rel="stylesheet" type="text/css"/>
    <!-- Bootstrap 3.3.4 -->
    <link href="<%=basePath%>assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <!-- Font Awesome Icons -->
    <link href="<%=basePath%>assets/dist/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <!-- Ionicons -->
    <link href="<%=basePath%>assets/dist/css/ionicons.min.css" rel="stylesheet" type="text/css"/>
    <!-- Theme style -->
    <link href="<%=basePath%>assets/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css"/>
    <link href="<%=basePath%>assets/dist/css/skins/skin-blue.min.css" rel="stylesheet" type="text/css"/>
    <link href="<%=basePath%>assets/dist/css/style.css" rel="stylesheet" type="text/css"/>
    <!--[if lt IE 9]>
    <script src="<%=basePath%>assets/dist/js/html5shiv.min.js"></script>
    <script src="<%=basePath%>assets/dist/js/respond.min.js"></script>
    <![endif]-->

</head>


<body class="skin-blue sidebar-mini">
<div class="wrapper">

    <!-- Main Header -->
    <header class="main-header">

        <!-- Logo -->
        <a href="index2.html" class="logo">
            <span class="logo"><img src="<%=basePath%>assets/dist/img/logo.png"/></span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle visible-xs" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <!-- search form (Optional) -->
            <form action="#" method="get" class="sidebar-form sidebar-form-width pull-left hidden-xs">
                <div class="input-group">
                    <input type="text" name="q" class="form-control" placeholder="Search..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
                </div>
            </form>
            <!-- /.search form -->
            <span class="title hidden-xs">interlaw</span>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- Messages: style can be found in dropdown.less-->
                    <li class="dropdown messages-menu">
                        <!-- Menu toggle button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-envelope-o"></i>
                        </a>
                        <ul class="dropdown-menu">
                        </ul>
                    </li><!-- /.messages-menu -->


                    <!-- Tasks Menu -->
                    <li class="dropdown tasks-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-flag-o"></i>
                            <span class="label label-danger">9</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="header">You have 9 tasks</li>
                            <li>
                                <!-- Inner menu: contains the tasks -->
                                <ul class="menu">
                                    <li><!-- Task item -->
                                        <a href="#">
                                            <!-- Task title and progress text -->
                                            <h3>
                                                Design some buttons
                                                <small class="pull-right">20%</small>
                                            </h3>
                                            <!-- The progress bar -->
                                            <div class="progress xs">
                                                <!-- Change the css width attribute to simulate progress -->
                                                <div class="progress-bar progress-bar-aqua" style="width: 20%"
                                                     role="progressbar" aria-valuenow="20" aria-valuemin="0"
                                                     aria-valuemax="100">
                                                    <span class="sr-only">20% Complete</span>
                                                </div>
                                            </div>
                                        </a>
                                    </li><!-- end task item -->
                                </ul>
                            </li>
                            <li class="footer">
                                <a href="#">View all tasks</a>
                            </li>
                        </ul>
                    </li>
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <!-- The user image in the navbar-->
                            <img src="<%=basePath%>assets/dist/img/user2-160x160.jpg" class="user-image"
                                 alt="User Image"/>
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs">&nbsp;</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img src="<%=basePath%>assets/dist/img/user2-160x160.jpg" class="img-circle"
                                     alt="User Image"/>
                                <p>
                                    Alexander Pierce - Web Developer
                                    <small>Member since Nov. 2012</small>
                                </p>
                            </li>
                            <!-- Menu Body -->
                            <li class="user-body">
                                <div class="col-xs-4 text-center">
                                    <a href="#">Followers</a>
                                </div>
                                <div class="col-xs-4 text-center">
                                    <a href="#">Sales</a>
                                </div>
                                <div class="col-xs-4 text-center">
                                    <a href="#">Friends</a>
                                </div>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="#" class="btn btn-default btn-flat">Profile</a>
                                </div>
                                <div class="pull-right">
                                    <a href="#" class="btn btn-default btn-flat">Sign out</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">

        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <!-- Sidebar user panel (optional) -->
            <div class="user-panel">
                <div class="image">
                    <img src="<%=basePath%>assets/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
                </div>

            </div>


            <!-- Sidebar Menu -->
            <ul class="sidebar-menu">
                <!-- Optionally, you can add icons to the links -->
                <li class="active"><a href="#"><i class='fa fa-check-circle'></i>
                    <p>案件</p></a></li>
                <li><a href="#"><i class='fa fa-credit-card'></i>
                    <p>任务</p></a></li>
                <li><a href="#"><i class='fa fa-cube'></i>
                    <p>动态</p></a></li>
                <li><a href="#"><i class='fa fa-calculator'></i>
                    <p>日程</p></a></li>
                <li><a href="#"><i class='fa fa-hand-o-left'></i>
                    <p>人员</p></a></li>
                <li><a href="#"><i class='fa fa-hand-o-right'></i>
                    <p>通知</p></a></li>
                <li><a href="#"><i class='fa fa-fax'></i>
                    <p>私信</p></a></li>
                <li><a href="#"><i class='fa fa-thumbs-o-down'></i>
                    <p>个人</p></a></li>

            </ul><!-- /.sidebar-menu -->
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>我的案件</h1>
            <ol class="breadcrumb">
                <li><a href="<%=basePath%>collisionDetection.jsp">+ 添加案件</a></li>
                <li><a href="#"><i class='glyphicon glyphicon-align-justify'></i></a></li>
                <li><a href="#"><i class='glyphicon glyphicon-list hui'></i></a></li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <c:forEach var="item" items="${caseList}" varStatus="vs">
                <div class="col-lg-3 col-xs-6">
                    <c:choose>
                    <c:when test="${item.caseExamine==2}">
                        <div class="small-box bg-gray">
                    </c:when>  <c:when test="${item.caseExamine==0}">
                        <div class="small-box bg-gray">
                    </c:when>
                    <c:otherwise>
                        <c:if test="${vs.index%5==0}">
                        <div class="small-box bg-aqua">

                            </c:if>
                            <c:if test="${vs.index%5==1}">
                            <div class="small-box bg-orange">

                                </c:if>
                                <c:if test="${vs.index%5==2}">
                                <div class="small-box bg-red">

                                    </c:if>
                                    <c:if test="${vs.index%5==3}">
                                    <div class="small-box bg-green">

                                        </c:if>
                                            <c:if test="${vs.index%5==4}">
                                    <div class="small-box bg-blue">

                                        </c:if>
                    </c:otherwise>
                    </c:choose>


                                    <div class="inner">
                                        <h3>${item.caseName}</h3>
                                        <p><fmt:formatDate value="${item.caseCreateTime}" pattern="yyyy/MM/dd"/></p>
                                        <p class="has-line has-line-1">${item.casePreType}</p>
                                    </div>
                                            <c:if test="${item.caseExamine==2}">
                                                <div class="icon" style="position: absolute;top: 5px;">
                                                    <img src="<%=basePath%>img/no.png">
                                                </div>
                                            </c:if>
                                            <c:if test="${item.caseExamine==0}">
                                                <div class="icon" style="position: absolute;top: 5px;">
                                                    <img src="<%=basePath%>img/dd.png">
                                                </div>
                                            </c:if>
                                    <div class="icon">

                                        <i class="fa fa-medkit"></i>
                                    </div>
                                </div>
                            </div>
                            <!-- ./col -->
                            </c:forEach>
                            <div class="col-lg-3 col-xs-6">
                                <!-- small box -->
                                <div class="small-box bg-white">
                                    <div onclick="window.location.href='<%=basePath%>collisionDetection.jsp'"
                                         class="inner">
                                        <h3>+</h3>
                                        <p>添加案件</p>
                                        <p class="has-line has-line-6">
                                            &nbsp;
                                        <div class="icon">
                                            <i class="fa fa-medkit"></i>
                                        </div>
                                    </div>
                                </div><!-- ./col -->
                            </div>
                            <div class="col-lg-3 col-xs-6">
                                <a href="#" class="more-read" style="height: auto;"><i class="fa fa-fw fa-eye"></i>
                                    查看更多案件</a>
                            </div>

                        </div>
                        <div class="col-md-7 pl-none">
                            <!-- Custom Tabs (Pulled to the right) -->
                            <div class="nav-tabs-custom">
                                <ul class="nav nav-tabs pull-right">

                                    <li class=""><a href="#tab_3-2" data-toggle="tab" aria-expanded="false">关注的人</a>
                                    </li>
                                    <li class=""><a href="#tab_2-2" data-toggle="tab" aria-expanded="false">关注的项目</a>
                                    </li>
                                    <li class="active"><a href="#tab_1-1" data-toggle="tab"
                                                          aria-expanded="true">我的项目</a></li>
                                    </li>
                                    <li class="pull-left header"><i class="glyphicon glyphicon-pushpin"></i> 动态</li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane active" id="tab_1-1">

                                    </div><!-- /.tab-pane -->
                                    <div class="box-footer">
                                        <a href="javascript:void(0)" onclick="getMoreDynamic()"><i
                                                class="fa fa-fw fa-eye"></i>
                                            查看更多动态</a>
                                    </div>
                                    <div class="tab-pane" id="tab_2-2">
                                        The European languages are members of the same family. Their separate existence
                                        is a myth.
                                        For science, music, sport, etc, Europe uses the same vocabulary. The languages
                                        only differ
                                        in their grammar, their pronunciation and their most common words. Everyone
                                        realizes why a
                                        new common language would be desirable: one could refuse to pay expensive
                                        translators. To
                                        achieve this, it would be necessary to have uniform grammar, pronunciation and
                                        more common
                                        words. If several languages coalesce, the grammar of the resulting language is
                                        more simple
                                        and regular than that of the individual languages.
                                    </div><!-- /.tab-pane -->
                                    <div class="tab-pane" id="tab_3-2">
                                        Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                                        Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
                                        when an unknown printer took a galley of type and scrambled it to make a type
                                        specimen book.
                                        It has survived not only five centuries, but also the leap into electronic
                                        typesetting,
                                        remaining essentially unchanged. It was popularised in the 1960s with the
                                        release of
                                        Letraset
                                        sheets containing Lorem Ipsum passages, and more recently with desktop
                                        publishing software
                                        like Aldus PageMaker including versions of Lorem Ipsum.
                                    </div><!-- /.tab-pane -->
                                </div><!-- /.tab-content -->
                            </div><!-- nav-tabs-custom -->
                        </div>

                        <div class="col-md-5 pr-none pl-none">
                            <!-- DIRECT CHAT DANGER -->
                            <div class="box box-danger direct-chat direct-chat-danger">

                                <div class="nav-tabs-custom">
                                    <ul class="nav nav-tabs pull-right">

                                        <li class="pull-left header"><i class="fa fa-file-text-o"></i>任务</li>
                                        <li class="active pull-left"><a href="#tab_4-1" data-toggle="tab"
                                                                        aria-expanded="false">我的任务（<span
                                                id="tome_task_num_span"></span>件）</a>
                                        </li>
                                        <li class="pull-left"><a href="#tab_4-2" data-toggle="tab"
                                                                 aria-expanded="true">已分配任务（<span
                                                id="me_create_task_num_span"></span>件）</a>
                                        </li>
                                        <li class=""><a href="javascript:void(0)"
                                                        onclick="clickAddTaskButton()">+添加任务</a></li>
                                    </ul>
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="tab_4-1">
                                            <ul class="todo-list ui-sortable" id="tometask_ul">

                                            </ul>
                                        </div><!-- /.tab-pane -->
                                        <div class="tab-pane" id="tab_4-2">
                                            <ul class="todo-list ui-sortable" id="mecreatetask_ul">

                                            </ul>
                                        </div><!-- /.tab-pane -->
                                    </div><!-- /.tab-content -->
                                </div><!-- nav-tabs-custom -->

                            </div><!--/.direct-chat -->
                            <div class="box box-warning direct-chat direct-chat-warning">
                                <div class="box-header with-border">
                                    <h3 class="box-title"><i class="fa fa-file-text-o"></i> 日程
                                        <small><fmt:formatDate value="<%=new Date()%>"
                                                               pattern="yyyy/MM/dd"></fmt:formatDate></small>
                                    </h3>
                                    <div class="pull-right">
                                        <a href="javascript:void(0)" onclick="clickAddSchedule()"
                                           class="warning">+添加日程</a>
                                    </div>
                                </div><!-- /.box-header -->
                                <div class="box-body">
                                    <ul id="schedule_ul" class="todo-list ui-sortable">

                                    </ul>
                                </div><!-- /.box-body -->
                                <div class="box-footer">
                                    <a href="#"><i class="fa fa-fw fa-eye"></i> 查看更多日程</a>
                                </div><!-- /.box-footer-->
                            </div><!--/.direct-chat -->
                        </div>

        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->


    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
            <li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
            <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!-- Home tab content -->
            <div class="tab-pane active" id="control-sidebar-home-tab">
                <h3 class="control-sidebar-heading">Recent Activity</h3>
                <ul class='control-sidebar-menu'>
                    <li>
                        <a href='javascript::;'>
                            <i class="menu-icon fa fa-birthday-cake bg-red"></i>
                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
                                <p>Will be 23 on April 24th</p>
                            </div>
                        </a>
                    </li>
                </ul><!-- /.control-sidebar-menu -->

                <h3 class="control-sidebar-heading">Tasks Progress</h3>
                <ul class='control-sidebar-menu'>
                    <li>
                        <a href='javascript::;'>
                            <h4 class="control-sidebar-subheading">
                                Custom Template Design
                                <span class="label label-danger pull-right">70%</span>
                            </h4>
                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                            </div>
                        </a>
                    </li>
                </ul><!-- /.control-sidebar-menu -->

            </div><!-- /.tab-pane -->
            <!-- Stats tab content -->
            <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div><!-- /.tab-pane -->
            <!-- Settings tab content -->
            <div class="tab-pane" id="control-sidebar-settings-tab">
                <form method="post">
                    <h3 class="control-sidebar-heading">General Settings</h3>
                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Report panel usage
                            <input type="checkbox" class="pull-right" checked/>
                        </label>
                        <p>
                            Some information about this general settings option
                        </p>
                    </div><!-- /.form-group -->
                </form>
            </div><!-- /.tab-pane -->
        </div>
    </aside><!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class='control-sidebar-bg'></div>
</div><!-- ./wrapper -->


<div class="modal fade bs-example-modal-sm delete-confirm-task" tabindex="-1" role="dialog"
     aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            您要删除该任务吗？
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
            <button type="button" onclick="deleteTask()" class="btn btn-danger">确定</button>
        </div>
    </div>
</div>
<div class="modal fade bs-example-modal-sm delete-confirm-schedule" tabindex="-1" role="dialog"
     aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            您要删除该日程吗？
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
            <button type="button" onclick="deleteSchedule()" class="btn btn-danger">确定</button>
        </div>
    </div>
</div>
<!--ld-->
<!--遮罩层-->
<div class="zhezhao" style="display: none;"></div>
<!--新增日程-->

<!--新增任务-->
<div class="renwu_jian" id="create_schedule_modal_dialog" style="display: none;">
    <form id="add_schedule_form">
        <p class="renwu_jian1"><img class="guanbi" src="<%=basePath%>assets/dist/img/ld/d_01.jpg"/></p>
        <p class="renwu_jian2"><img src="<%=basePath%>assets/dist/img/ld/d_05.jpg"/><span>新增日程</span></p>
        <div class="renwu_jian3">
            <p class="renwu_jian3p2">
                <span class="w_span">内容</span>
                <textarea name="content"></textarea>
            </p>
            <p class="renwu_fu1">
                <span class="w_span">案件</span>
                <select name="caseId" id="add_schedule_select_case">

                </select>
            </p>
            <p class="new_p1">
                <span class="w_span">开始时间</span>
                <input name="beginDate" type="text" onclick="clickDateInput()"/>
                <select name="beginTime">
                    <option value="00:00">00:00</option>

                    <option value="01:00">01:00</option>
                    <option value="02:00">02:00</option>
                    <option value="03:00">03:00</option>
                    <option value="04:00">04:00</option>
                    <option value="05:00">05:00</option>
                    <option value="06:00">06:00</option>
                    <option value="07:00">07:00</option>
                    <option value="08:00">08:00</option>
                    <option selected="true" value="09:00">09:00</option>
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    <option value="18:00">18:00</option>
                    <option value="19:00">19:00</option>
                    <option value="20:00">20:00</option>
                    <option value="21:00">21:00</option>

                    <option value="22:00">22:00</option>

                    <option value="23:00">23:00</option>
                </select>
            </p>
            <p class="new_p1">
                <span class="w_span">结束时间</span>
                <input name="endDate" type="text" onclick="clickDateInput()"/>
                <select name="endTime">
                    <option value="00:00">00:00</option>

                    <option value="01:00">01:00</option>
                    <option value="02:00">02:00</option>
                    <option value="03:00">03:00</option>
                    <option value="04:00">04:00</option>
                    <option value="05:00">05:00</option>
                    <option value="06:00">06:00</option>
                    <option value="07:00">07:00</option>
                    <option value="08:00">08:00</option>
                    <option selected="true" value="09:00">09:00</option>
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    <option value="18:00">18:00</option>
                    <option value="19:00">19:00</option>
                    <option value="20:00">20:00</option>
                    <option value="21:00">21:00</option>

                    <option value="22:00">22:00</option>

                    <option value="23:00">23:00</option>
                </select>
            </p>
            <p class="renwu_jian3p3">
                <span></span>
                <img class="img_xia1" src="<%=basePath%>assets/dist/img/ld/d_03.jpg"/>
                <b>提醒方式</b>
                <span></span>
            </p>

        </div>

        <div class="renwu_fu1">
            <p class="renwu_fu1p1">
                <span><input type="radio" name="alertType" value="2"/>消息提醒</span>
                <span><input type="radio" name="alertType" value="1"/>手机提醒</span>
                <span><input type="radio" name="alertType" value="3"/>双提醒</span>
            </p>
            <p class="renwu_fu1p2 clearfix">
                <span class="w_span">手机号码</span>
                <input name="phone" type="text"/>
                <img class="huoqu" src="<%=basePath%>assets/dist/img/ld/d_07.jpg"/>
            </p>
            <p class="renwu_fu1p3 clearfix">
                <span class="w_span">验证码</span>
                <span class="renwu_fu1p31"></span>
                <span class="renwu_fu1p32">重新发送</span>
            </p>
            <p class="renwu_fu2">
                <span class="w_span">重复</span>
                <select name="retryTime">
                    <option selected="selected" value="1">1次</option>

                    <option value="2">2次</option>

                    <option value="3">3次</option>

                </select>
            </p>
            <p class="renwu_fu3">
                <span class="w_span">提醒</span>
                <select>
                    <option selected="selected" value="1">提前一小时</option>

                    <option value="2">提前一天</option>

                    <option value="3">提前一周</option>

                </select>
            </p>
            <p class="renwu_fu1p3">
                <span class="w_span">地点</span>
                <input name="address" type="text"/>
            </p>

        </div>

        <p class="renwu_jian3p4">
            <span onclick="clickSubmitAddSchedule()" class="renwu_jian3p40">添加日程</span>
            <span class="renwu_jian3p41">取消</span>
        </p>
    </form>

</div>
<!--修改日程-->
<div class="renwu_jian" id="update_schedule_modal_dialog" style="display: none;">
    <form id="update_schedule_form">
        <input type="hidden" value="" name="id"/>
        <p class="renwu_jian1"><img class="guanbi" src="<%=basePath%>assets/dist/img/ld/d_01.jpg"/></p>
        <p class="renwu_jian2"><img src="<%=basePath%>assets/dist/img/ld/d_05.jpg"/><span>修改日程</span></p>
        <div class="renwu_jian3">
            <p class="renwu_jian3p2">
                <span class="w_span">内容</span>
                <textarea name="content"></textarea>
            </p>
            <p class="renwu_fu1">
                <span class="w_span">案件</span>
                <select name="caseId" id="update_schedule_select_case">

                </select>
            </p>
            <p class="new_p1">
                <span class="w_span">开始时间</span>
                <input name="beginDate" type="text" onclick="clickDateInput()"/>
                <select name="beginTime">
                    <option value="00:00">00:00</option>

                    <option value="01:00">01:00</option>
                    <option value="02:00">02:00</option>
                    <option value="03:00">03:00</option>
                    <option value="04:00">04:00</option>
                    <option value="05:00">05:00</option>
                    <option value="06:00">06:00</option>
                    <option value="07:00">07:00</option>
                    <option value="08:00">08:00</option>
                    <option selected="true" value="09:00">09:00</option>
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    <option value="18:00">18:00</option>
                    <option value="19:00">19:00</option>
                    <option value="20:00">20:00</option>
                    <option value="21:00">21:00</option>

                    <option value="22:00">22:00</option>

                    <option value="23:00">23:00</option>
                </select>
            </p>
            <p class="new_p1">
                <span class="w_span">结束时间</span>
                <input name="endDate" type="text" onclick="clickDateInput()"/>
                <select name="endTime">
                    <option value="00:00">00:00</option>

                    <option value="01:00">01:00</option>
                    <option value="02:00">02:00</option>
                    <option value="03:00">03:00</option>
                    <option value="04:00">04:00</option>
                    <option value="05:00">05:00</option>
                    <option value="06:00">06:00</option>
                    <option value="07:00">07:00</option>
                    <option value="08:00">08:00</option>
                    <option selected="true" value="09:00">09:00</option>
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    <option value="18:00">18:00</option>
                    <option value="19:00">19:00</option>
                    <option value="20:00">20:00</option>
                    <option value="21:00">21:00</option>

                    <option value="22:00">22:00</option>

                    <option value="23:00">23:00</option>
                </select>
            </p>
            <p class="renwu_jian3p3">
                <span></span>
                <img class="img_xia1" src="<%=basePath%>assets/dist/img/ld/d_03.jpg"/>
                <b>提醒方式</b>
                <span></span>
            </p>

        </div>

        <div class="renwu_fu1">
            <p class="renwu_fu1p1">
                <span><input type="radio" name="alertType" value="2"/>消息提醒</span>
                <span><input type="radio" name="alertType" value="1"/>手机提醒</span>
                <span><input type="radio" name="alertType" value="3"/>双提醒</span>
            </p>
            <p class="renwu_fu1p2 clearfix">
                <span class="w_span">手机号码</span>
                <input name="phone" type="text"/>
                <img class="huoqu" src="<%=basePath%>assets/dist/img/ld/d_07.jpg"/>
            </p>
            <p class="renwu_fu1p3 clearfix">
                <span class="w_span">验证码</span>
                <span class="renwu_fu1p31"></span>
                <span class="renwu_fu1p32">重新发送</span>
            </p>
            <p class="renwu_fu2">
                <span class="w_span">重复</span>
                <select name="retryTime">
                    <option selected="selected" value="1">1次</option>

                    <option value="2">2次</option>

                    <option value="3">3次</option>

                </select>
            </p>
            <p class="renwu_fu3">
                <span class="w_span">提醒</span>
                <select>
                    <option selected="selected" value="1">提前一小时</option>

                    <option value="2">提前一天</option>

                    <option value="3">提前一周</option>

                </select>
            </p>
            <p class="renwu_fu1p3">
                <span class="w_span">地点</span>
                <input name="address" type="text"/>
            </p>

        </div>

        <p class="renwu_jian3p4">
            <span onclick="clickSubmitUpdateSchedule()" class="renwu_jian3p40">修改日程</span>
            <span class="renwu_jian3p41">取消</span>
        </p>
    </form>

</div>


<!--新增任务-->
<div class="renwu_jian" style="display: none;" id="create_task_modal_dialog">
    <form id="add_renwu_form">
        <p class="renwu_jian1"><img class="guanbi" src="<%=basePath%>assets/dist/img/ld/d_01.jpg"/></p>
        <p class="renwu_jian2"><img src="<%=basePath%>assets/dist/img/ld/d_02.jpg"/><span>新增任务</span></p>
        <div class="renwu_jian3">
            <p class="renwu_jian3p1">
                <span class="w_span">内容</span>
                <input type="text" name="content"/>
            </p>
            <p class="renwu_jian3p2">
                <span class="w_span">叙述</span>
                <textarea name="description"></textarea>
            </p>
            <p class="renwu_jian3p3">
                <span></span>
                <img class="img_xia" src="<%=basePath%>assets/dist/img/ld/d_03.jpg"/>
                <b>添加详细信息</b>
                <span></span>
            </p>

        </div>

        <div class="renwu_fu">
            <p class="renwu_fu1" style="display: block">
                <span class="w_span">案件</span>
                <select name="caseId" id="add_task_select_case">

                </select>
            </p>

            <p class="new_p1">
                <span class="w_span">指定成员</span>
                <select name="lawerId" id="add_task_select_lawerId"></select>
            </p>
            <p class="new_p1">
                <span class="w_span">截止日期</span>
                <input style="width: 250px;" onclick="clickDateInput()" type="text" name="deadline"/>
            </p>
            <p class="renwu_fu5">
                <span class="w_span">等级</span>
            <span class="renwu_fu50" id="add_task_stars">
            	<img src="<%=basePath%>assets/dist/img/ld/d_04.jpg"/>
                <img src="<%=basePath%>assets/dist/img/ld/d_04.jpg"/>
                <img src="<%=basePath%>assets/dist/img/ld/d_04.jpg"/>
            </span>
            </p>
        </div>

        <p class="renwu_jian3p4">
            <span class="renwu_jian3p40" onclick="clickSubmitAddTask()">添加任务</span>
            <span class="renwu_jian3p41">取消</span>
        </p>
    </form>
</div>
<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 2.1.4 -->
<script src="<%=basePath%>assets/dist/js/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.2 JS -->
<script src="<%=basePath%>assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="<%=basePath%>assets/dist/js/app.min.js" type="text/javascript"></script>
<script src="<%=basePath%>My97DatePicker/WdatePicker.js" type="text/javascript"></script>

<script type="text/javascript" src="<%=basePath%>js/baiduTemplate.js"></script>
<script>
    $(function () {
        $('.todo-list>li>.pull-left>input[type=checkbox]').click(function () {
            $(this).parents('.pull-left').parent('li').toggleClass('done');
        });

        $('.todo-list>li .fenshu i').click(function () {
            $(this).removeClass('glyphicon-star-empty').addClass('glyphicon-star').addClass('g-red');
            $(this).prevAll('i').removeClass('glyphicon-star-empty').addClass('glyphicon-star').addClass('g-red');
            $(this).nextAll('i').removeClass('glyphicon-star').removeClass('g-red').addClass('glyphicon-star-empty');
        });

    })

</script>
</body>
</html>
<!--日程模板-->
<script type="text/template" id="index_schedule_template">

    <!for(var i=0;i
    <data.length;i++){!>
    <li id="id_index_schedule_li_<!=data[i].id!>">

        <div class="fenshu pull-left">
            <input onclick="clickScheduleCheckBox('<!=data[i].id!>',this)" type="checkbox" value="" name="">
        </div>

                      <span class="text pull-left"><!=data[i].content!><div class="tool-body">
                          <small class="label"><i id="index_schedule_i_<!=data[i].id!>"
                                                  class="glyphicon glyphicon-repeat"></i>
                              <span id="index_schedule_date_<!=data[i].id!>"><!=data[i].beginShow!>&nbsp;/&nbsp;<!=data[i].endShow!></span>
                          </small>
                          <!-- General tools such as edit or delete-->
                          <div class="tools">
                              <i class="fa fa-edit" onclick="clickEditSchedule('<!=data[i].id!>')"></i>
                              <i class="fa fa-trash-o" data-toggle="modal"
                                 onclick="clickDeleteSchedule('<!=data[i].id!>')"
                                 data-target=".delete-confirm-schedule"></i>
                          </div>
                      </div>
                      </span>
    </li>
    <!}!>
</script>
<!--动态模板-->
<script type="text/template" id="index_dynamic_template">
    <!for(var i=0;i
    <data.length;i++){!>
    <ul class="timeline">
        <!if(data[i].isToday){!>
        <li class="time-label"><span>今天（<!=data[i].date!> <!=data[i].weekShow!>）</span></li>
        <!}else{!>
        <li class="time-label"><span><!=data[i].date!> <!=data[i].weekShow!></span></li>
        <!}!>
        <!for(var k=0;k
        <data
                [i].dataList.length;k++){!>

            <li recordId="<!=data[i].dataList[k].recordId!>">
                <i class="glyphicon glyphicon-list-alt"></i>
                <div class="timeline-item">
                    <span class="time"><!=data[i].dataList[k].time!></span>
                    <div class="timeline-body">
                        <p><a href="#"><!=data[i].dataList[k].showContent1!></a><!=data[i].dataList[k].showContent2!><a
                                href="#"><!=data[i].dataList[k].showContent3!></a><!=data[i].dataList[k].showContent4!>
                            <a href="#"><!=data[i].dataList[k].showContent6!></a><!=data[i].dataList[k].showContent7!>
                        </p>
                        <p><span href="#"><i class='fa fa-file-text-o'></i></span>
                            <!=data[i].dataList[k].showContent5!></p>
                    </div>
                </div>
            </li>
            <!}!>

    </ul>
    <!}!>
</script>
<!--分配给我的任务模板-->
<script type="text/template" id="index_tometask_template">
    <!for(var i=0;i
    <data.dataList.length;i++){!>
    <li>
        <div class="fenshu pull-left">
            <input type="checkbox" onclick="clickMyTaskCheckBox('<!=data.dataList[i].id!>',this)" value="" name="">
            <!for(var k=0;k
            <data.dataList
                    [i].stars;k++){!>
                <i class="glyphicon glyphicon-star g-red"></i>
                <!}!>
                <!for(var k=0;k<3-data.dataList[i].stars;k++){!>
                <i class="glyphicon glyphicon-star-empty"></i>
                <!}!>
        </div>
                      <span class="text pull-left"> <!=data.dataList[i].content!>
                        <div class="tool-body">
                            <!if(data.dataList[i].deadLineShow){!>
                            <small class="label label-danger"><i class="glyphicon glyphicon-list-alt"></i>
                                <!=data.dataList[i].deadLineShow!>
                            </small>
                            <!}!>
                            <!-- General tools such as edit or delete-->
                            <div class="tools">
                                <i class="glyphicon glyphicon-repeat"></i>
                                <span><!=data.dataList[i].createTimeShow!></span>
                            </div>
                        </div>
                      </span>
        <!-- Emphasis label -->
    </li>
    <!}!>
</script>
<!--我创建的任务模板-->
<script type="text/template" id="index_mecreatetask_template">
    <!for(var i=0;i
    <data.dataList.length;i++){!>
    <li>
        <!-- checkbox -->
        <div class="fenshu pull-left">
            <!for(var k=0;k
            <data.dataList
                    [i].stars;k++){!>
                <i onclick="changeStar(this,'<!=data.dataList[i].id!>')" class="glyphicon glyphicon-star g-red"></i>
                <!}!>
                <!for(var k=0;k<3-data.dataList[i].stars;k++){!>
                <i onclick="changeStar(this,'<!=data.dataList[i].id!>')" class="glyphicon glyphicon-star-empty"></i>
                <!}!>
        </div>
                       <span class="text pull-left"> <!=data.dataList[i].content!>
                         <div class="tool-body">
                             <!for(var j=0;j
                             <data.dataList
                                     [i].renwuren.length;j++){!>
                                 <span style="padding-left: 20px;"><!=data.dataList[i].renwuren[j].name!></span>
                                 <!}!>
                                 <!if(data.dataList[i].deadLineShow){!>
                                 <small class="label label-danger"><i class="glyphicon glyphicon-list-alt"></i>
                                     <!=data.dataList[i].deadLineShow!>
                                 </small>
                                 <!}!>
                                 <div class="tools">
                                     <i class="glyphicon glyphicon-repeat"></i>
                                     <span><!=data.dataList[i].createTimeShow!></span>
                                     <i class="fa fa-trash-o" data-toggle="modal"
                                        onclick="clickDeleteTask('<!=data.dataList[i].id!>')"
                                        data-target=".delete-confirm-task"></i>
                                 </div>
                         </div>
                       </span>
    </li>
    <!}!>
</script>
<script>

    var deleteSchedulId = 0;
    var deleteTaskId = 0;

    $(function () {

        //设置左分隔符为 <!
        baidu.template.LEFT_DELIMITER = '<!';

        //设置右分隔符为 <!
        baidu.template.RIGHT_DELIMITER = '!>';

        getDynamic(0, 5);
        getSchedule();
        getTask();

        getMyTask();
        zhezhao();
        guanbi()

        renwu_jian()
        renwu_fu50()
        renwu_fu();

        queryAllCases();

        queryAllLawers();


    });
    //删除任务
    function deleteTask() {
        $('.delete-confirm-task').modal('hide');
        $.ajax({
            url: "<%=basePath%>main/deleteTask.do",
            dataType: 'json',
            data: {taskId: deleteTaskId},
            type: 'post',
            success: function (data) {
                getTask();
                getMyTask();
            }
        });
    }
    //点击提交添加任务
    function clickSubmitAddTask() {
        var data = {};
        var serializearray = $('#add_renwu_form').serializeArray();
        var length = serializearray.length;
        for (var i = 0; i < length; i++) {
            var obj = serializearray[i];
            data[obj.name] = obj.value;
        }
        var stars = $('#add_task_stars img');
        var _length = stars.length;
        var startNum = 0;
        for (var i = 0; i < _length; i++) {
            var _src = $(stars[i]).attr('src');
            var reg = /d_04_ac.jpg/;
            if (reg.test(_src)) {
                startNum++;
            }
        }
        data.stars = startNum;
        $.ajax({
            url: "<%=basePath%>main/addTask.do",
            dataType: 'json',
            type: 'post',
            data: data,
            success: function (data) {
                getTask();
                getMyTask();
                $('.zhezhao').css('display', 'none')
                $('#create_task_modal_dialog').css('display', 'none')
            }
        });

    }

    //获取任务
    function getTask() {
        $.ajax({
            url: "<%=basePath%>main/getMeCreateTask.do",
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $('#me_create_task_num_span').html(data.data.size);
                var index_dynamic_template = baidu.template('index_mecreatetask_template');
                $('#mecreatetask_ul').html(index_dynamic_template(data));
            }
        });
    }
    //获取我的任务
    function getMyTask() {
        $.ajax({
            url: "<%=basePath%>main/getToMeTask.do",
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $('#tome_task_num_span').html(data.data.size);
                var index_dynamic_template = baidu.template('index_tometask_template');
                $('#tometask_ul').html(index_dynamic_template(data));
            }
        });
    }

    //获取所有律师
    function queryAllLawers() {
        $.ajax({
            url: "<%=basePath%>main/queryAllLawers.do",
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $(data.data).each(function (i, v) {
                    $('#add_task_select_lawerId').append("<option value='" + v.lawerId + "'>" + v.lawerName + "</option>");
                });
            }
        });
    }
    //点击修改日程按钮
    function clickEditSchedule(id) {

        $.ajax({
            url: "<%=basePath%>main/getSchedule.do",
            dataType: 'json',
            type: 'post',
            data: {"scheduleId": id},
            success: function (data) {

                $('#update_schedule_form textarea[name=content]').val(data.data.content);
                $('#update_schedule_form select[name=caseId]').val(data.data.caseId);
                $('#update_schedule_form input[name=beginDate]').val(data.data.beginDate);
                $('#update_schedule_form select[name=beginTime]').val(data.data.beginTime);
                $('#update_schedule_form input[name=endDate]').val(data.data.endDate);
                $('#update_schedule_form select[name=endTime]').val(data.data.endTime);
                $('#update_schedule_form select[name=retryTime]').val(data.data.retryTime);
                $('#update_schedule_form input[name=phone]').val(data.data.phone);
                $('#update_schedule_form input[name=alertType]').val(data.data.alertType);
                $('#update_schedule_form input[name=address]').val(data.data.address);
                $('#update_schedule_form input[name=id]').val(id);


                $('.zhezhao').show()
                $('#update_schedule_modal_dialog').show();
            }
        });
    }

    //点击提交添加日程
    function clickSubmitAddSchedule() {
        $('.zhezhao').css('display', 'none')
        $('#create_schedule_modal_dialog').css('display', 'none')
        var data = {};
        var serializearray = $('#add_schedule_form').serializeArray();
        var length = serializearray.length;
        for (var i = 0; i < length; i++) {
            var obj = serializearray[i];
            data[obj.name] = obj.value;
        }
        $.ajax({
            url: "<%=basePath%>main/addSchedule.do",
            dataType: 'json',
            type: 'post',
            data: data,
            success: function (data) {
                getSchedule();
            }
        });
    }
    //点击提交修改日程
    function clickSubmitUpdateSchedule() {
        $('.zhezhao').css('display', 'none')
        $('#update_schedule_modal_dialog').css('display', 'none')
        var data = {};
        var serializearray = $('#update_schedule_form').serializeArray();
        var length = serializearray.length;
        for (var i = 0; i < length; i++) {
            var obj = serializearray[i];
            data[obj.name] = obj.value;
        }
        $.ajax({
            url: "<%=basePath%>main/updateSchedule.do",
            dataType: 'json',
            type: 'post',
            data: data,
            success: function (data) {
                getSchedule();
            }
        });
    }
    //点击添加日程
    function clickAddSchedule() {
        $('.zhezhao').show()
        $('#create_schedule_modal_dialog').show();

    }

    //获取所有案件
    function queryAllCases() {
        $.ajax({
            url: "<%=basePath%>main/queryAllCases.do",
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $(data.data).each(function (i, v) {
                    $('#add_schedule_select_case').append("<option value='" + v.caseId + "'>" + v.caseName + "</option>");
                    $('#update_schedule_select_case').append("<option value='" + v.caseId + "'>" + v.caseName + "</option>");
                    $('#add_task_select_case').append("<option value='" + v.caseId + "'>" + v.caseName + "</option>");
                });
            }
        });
    }

    //点击时间输入框
    function clickDateInput() {
        WdatePicker();
    }

    //点击删除日程图标
    function clickDeleteSchedule(id) {
        deleteSchedulId = id;
    }
    //点击删除任务图标
    function clickDeleteTask(id) {
        deleteTaskId = id;
    }
    //删除日程
    function deleteSchedule() {
        $('.delete-confirm-schedule').modal('hide');
        $.ajax({
            url: "<%=basePath%>main/deleteSchedule.do",
            dataType: 'json',
            data: {scheduleId: deleteSchedulId},
            type: 'post',
            success: function (data) {
                getSchedule();
            }
        });
    }

    //查询动态
    function getDynamic(lastRecordId, num) {
        $.ajax({
            url: "<%=basePath%>main/queryDynamicState.do",
            dataType: 'json',
            data: {lastRecordId: lastRecordId, num: num},
            type: 'post',
            success: function (data) {
                var index_dynamic_template = baidu.template('index_dynamic_template');
                $('#tab_1-1').html(index_dynamic_template(data));
            }
        });
    }
    //查询日程
    function getSchedule() {
        $.ajax({
            url: "<%=basePath%>main/queryMySchedule.do",
            dataType: 'json',
            type: 'post',
            success: function (data) {
                if (data.ok) {
                    var index_schedule_template = baidu.template('index_schedule_template');
                    $('#schedule_ul').html(index_schedule_template(data));
                }

            }
        });
    }
    //点击查看更多动态
    function getMoreDynamic() {
        var childrenLis = $('#tab_1-1').find("li");
        var childrenLi = childrenLis[childrenLis.length - 1];
        var recordId = $(childrenLi).attr("recordId");
        getDynamic(recordId, 5);
    }

    //点击日程的checkbox
    function clickScheduleCheckBox(id, t) {
        if ($(t).is(':checked')) {
            //选中checkbox
            $(t).parent().parent().css('color', '#999');
            var spanContent = $(t).parent().next("span");
            spanContent.css('color', '#999').css('text-decoration', 'line-through');
            $('#index_schedule_date_' + id).css('color', '#999');
            $('#index_schedule_i_' + id).css('color', '#999');
            $.ajax({
                url: "<%=basePath%>main/completeSchedule.do",
                dataType: 'json',
                data: {scheduleId: id},
                type: 'post',
                success: function (data) {
                    console.info(data)
                }
            });
        } else {
            $(t).parent().parent().css('color', 'black');
            var spanContent = $(t).parent().next("span");
            spanContent.css('color', 'black').css('text-decoration', '');
            $('#index_schedule_date_' + id).css('color', '#dd4b39');
            $('#index_schedule_i_' + id).css('color', '#dd4b39');
            $.ajax({
                url: "<%=basePath%>main/openSchedule.do",
                dataType: 'json',
                data: {scheduleId: id},
                type: 'post',
                success: function (data) {
                    console.info(data)
                }
            });
        }
    }
    //点击我的任务的checkbox
    function clickMyTaskCheckBox(id, t) {
        if ($(t).is(':checked')) {
            //选中checkbox
            $(t).parent().parent().css('color', '#999');
            var spanContent = $(t).parent().next("span");
            spanContent.css('color', '#999').css('text-decoration', 'line-through');
            $('#index_schedule_date_' + id).css('color', '#999');
            $('#index_schedule_i_' + id).css('color', '#999');
            $.ajax({
                url: "<%=basePath%>main/completeTask.do",
                dataType: 'json',
                data: {taskId: id},
                type: 'post',
                success: function (data) {
                    console.info(data)
                }
            });
        } else {
            $(t).parent().parent().css('color', 'black');
            var spanContent = $(t).parent().next("span");
            spanContent.css('color', 'black').css('text-decoration', '');
            $('#index_schedule_date_' + id).css('color', '#dd4b39');
            $('#index_schedule_i_' + id).css('color', '#dd4b39');
            $.ajax({
                url: "<%=basePath%>main/openTask.do",
                dataType: 'json',
                data: {taskId: id},
                type: 'post',
                success: function (data) {
                    console.info(data)
                }
            });
        }
    }
    /*ld*/
    function zhezhao() {
        var do_width = $(document).width() + 'px';
        var do_height = $(document).height() + 'px';
        $('.zhezhao').css('width', do_width);
        $('.zhezhao').css('height', do_height);
    }

    /*点击X关闭*/
    function guanbi() {
        $('.guanbi').click(function () {
            $('.zhezhao').css('display', 'none')
            $('.renwu_jian').css('display', 'none')
        })
        $('.renwu_jian3p41').click(function () {
            $('.zhezhao').css('display', 'none')
            $('.renwu_jian').css('display', 'none')
        })
    }

    /*新增任务-简*/
    function renwu_jian() {
        var wi_width = $(window).width();
        var wi_height = $(window).height();
        var renwu_jian_w = $('#create_schedule_modal_dialog').outerWidth();
        var renwu_jian_h = $('#create_schedule_modal_dialog').outerHeight();

        var renwu_jian_l = (wi_width - renwu_jian_w) / 2 + 'px';
        var renwu_jian_t0 = (wi_height - renwu_jian_h) / 2;
        if (renwu_jian_t0 <= 0) {
            renwu_jian_t0 = 90;
        }
        var renwu_jian_t = renwu_jian_t0 + 'px';

        $('.renwu_jian').css('left', renwu_jian_l);
        $('.renwu_jian').css('top', renwu_jian_t);
    }

    function renwu_fu50() {
        $('.renwu_fu50 img').click(function () {
            if ($(this).attr('src') == '<%=basePath%>assets/dist/img/ld/d_04.jpg') {
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_04_ac.jpg')
            } else {
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_04.jpg')
            }
        })
    }


    /*展开提醒方式*/
    function renwu_fu() {
        $('.img_xia1').click(function () {
            if ($(this).attr('src') == '<%=basePath%>assets/dist/img/ld/d_03.jpg') {
                $('.renwu_fu1').css('display', 'block');
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_03_ac.jpg')
            } else {
                $('.renwu_fu1').css('display', 'none');
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_03.jpg')
            }

        })
        $('.img_xia').click(function () {
            if ($(this).attr('src') == '<%=basePath%>assets/dist/img/ld/d_03.jpg') {
                $('.renwu_fu').css('display', 'block');
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_03_ac.jpg')
            } else {
                $('.renwu_fu').css('display', 'none');
                $(this).attr('src', '<%=basePath%>assets/dist/img/ld/d_03.jpg')
            }

        })
    }

    //星星变化
    function changeStar(t, tid) {
        var message = $(t).attr('class');
        var reg = /g-red/;
        if (reg.test(message)) {
            var nextAll = $(t).nextAll();
            $(nextAll).each(function (i, v) {
                $(v).removeClass('glyphicon-star').removeClass(' g-red').addClass('glyphicon-star-empty');
            })
            $(t).removeClass('glyphicon-star').removeClass(' g-red').addClass('glyphicon-star-empty');
        } else {
            var prevAll = $(t).prevAll();
            $(prevAll).each(function (i, v) {
                $(v).addClass('glyphicon-star').addClass(' g-red').removeClass('glyphicon-star-empty');

            })
            $(t).addClass('glyphicon-star').addClass(' g-red').removeClass('glyphicon-star-empty');
        }
        var num = 0;
        var findIs = $(t).parent().find('i');
        var lengthIs = findIs.length;
        for (var i = 0; i < lengthIs; i++) {
            var message = $(findIs[i]).attr('class');
            var reg = /g-red/;
            if (reg.test(message)) {
                num++;
            }
        }

        $.ajax({
            url: "<%=basePath%>main/updateTaskStars.do",
            dataType: 'json',
            data: {taskId: tid, num: num},
            type: 'post',
            success: function (data) {
                console.info(data)
            }
        });
    }

    //添加任务
    function clickAddTaskButton() {
        $('.zhezhao').show()
        $('#create_task_modal_dialog').show();
    }
</script>
